package com.hspedu.collection_;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class CollectionE2 {
    public static void main(String[] args) {
        List arrayList = new ArrayList();
        for (int i = 0; i < 10; i++) {
            arrayList.add("hello");
        }
        arrayList.add(1,"韩顺平教育");
        Object obj = arrayList.get(4);
        arrayList.remove(5);
        arrayList.set(6,"hsp");
        Iterator iterator = arrayList.iterator();
        while (iterator.hasNext()) {
            Object next = iterator.next();
            System.out.println(next);
        }
    }
}
